home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / pcq_incl3v1.lha / Graphics / Copper.i < prev    next >
Encoding:
Text File  |  1994-04-15  |  3.2 KB  |  109 lines

  1. {
  2.     Copper.i for PCQ Pascal
  3.  
  4.     This file defines the types, constants and routines necessary for
  5.     using Copper lists.  Note that the C macros CEND, CINIT, etc. were
  6.     renamed _CEND, _CINIT, _CMOVE, and _CWAIT to avoid name conflicts
  7.     with the actual graphics routines.  Also note that you'll have to
  8.     open GfxBase before you can use any of these routines.
  9. }
  10.  
  11. const
  12.  
  13.     COPPER_MOVE = 0;    { pseude opcode for move #XXXX,dir }
  14.     COPPER_WAIT = 1;    { pseudo opcode for wait y,x }
  15.     CPRNXTBUF   = 2;    { continue processing with next buffer }
  16.     CPR_NT_LOF  = $8000; { copper instruction only for short frames }
  17.     CPR_NT_SHT  = $4000; { copper instruction only for long frames }
  18.     CPR_NT_SYS  = $2000; { copper user instruction only }
  19. type
  20.  
  21. { Note: The combination VWaitAddr and HWaitAddr replace a three way
  22.         union in C.  The three possibilities are:
  23.  
  24.         nxtList : CopListPtr;  or
  25.  
  26.         VWaitPos : Short;
  27.         HWaitPos : Short;  or
  28.  
  29.         DestAddr : Short;
  30.         DestData : Short;
  31. }
  32.  
  33.     CopIns = record
  34.         OpCode  : Short; { 0 = move, 1 = wait }
  35.         VWaitAddr : Short; { vertical or horizontal wait position }
  36.         HWaitData : Short; { destination address or data to send }
  37.     end;
  38.     CopInsPtr = ^CopIns;
  39.  
  40. { structure of cprlist that points to list that hardware actually executes }
  41.  
  42.     cprlist = Record
  43.         Next    : ^cprlist;
  44.         start   : ^Short;       { start of copper list }
  45.         MaxCount : Short;       { number of long instructions }
  46.     end;
  47.     cprlistptr = ^cprlist;
  48.  
  49.     CopList = record
  50.         Next    : ^CopList;     { next block for this copper list }
  51.         _CopList : ^CopList;    { system use }
  52.         _ViewPort : Address;    { system use }
  53.         CopIns  : CopInsPtr;    { start of this block }
  54.         CopPtr  : CopInsPtr;    { intermediate ptr }
  55.         CopLStart : ^Short;     { mrgcop fills this in for Long Frame}
  56.         CopSStart : ^Short;     { mrgcop fills this in for Short Frame}
  57.         Count   : Short;        { intermediate counter }
  58.         MaxCount : Short;       { max # of copins for this block }
  59.         DyOffset : Short;       { offset this copper list vertical waits }
  60.     end;
  61.     CopListPtr = ^CopList;
  62.  
  63.  
  64.     UCopList = Record
  65.         Next    : ^UCopList;
  66.         FirstCopList : CopListPtr;      { head node of this copper list }
  67.         CopList : CopListPtr;           { node in use }
  68.     end;
  69.     UCopListPtr = ^UCopList;
  70.  
  71.  
  72.     copinit = record
  73.         diagstrt : Array [0..3] of Short; { copper list for first bitplane }
  74.         sprstrtup : Array [0..(2*8*2)+2+(2*2)+1] of Short;
  75.         sprstop : Array [0..1] of Short;
  76.     end;
  77.     copinitptr = ^copinit;
  78.  
  79. Procedure CBump(c : UCopListPtr);
  80.     External;
  81.  
  82. Procedure CMove(c : UCopListPtr; a : Address; v : Short);
  83.     External;
  84.  
  85. Procedure CWait(c : UCopListPtr; v, h : Short);
  86.     External;
  87.  
  88. Procedure FreeCopList(coplist : CopListPtr);
  89.     External;
  90.  
  91. Procedure FreeCprList(cpr : cprlistptr);
  92.     External;
  93.  
  94. Function UCopperListInit(UCopList : UCopListPtr; n : Short) : UCopListPtr;
  95.     External;
  96.  
  97. Procedure _CEND(c : UCopListPtr);
  98.     External;
  99.  
  100. Function _CINIT(UCopList : UCopListPtr; n : Short) : UCopListPtr;
  101.     External;
  102.  
  103. Procedure _CMOVE();
  104.     External;
  105.  
  106. Procedure _CWAIT(UCopList : UCopListPtr; v, h : Short);
  107.     External;
  108.  
  109.